package ui.handlers;

import ui.HomeScreen;
import ui.ManagerHomeScreen;
import ui.CashierHomeScreen;
import ui.ChefHomeScreen;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class RoleHandler implements ActionListener {

	private HomeScreen homeScrn = null;
	
	public RoleHandler(HomeScreen hs)
	{ homeScrn = hs; }
	
	public void actionPerformed(ActionEvent e)
	{
		if (homeScrn != null)
		{
			if (e.getSource() == homeScrn.getManagerButton())
			{ new ManagerHomeScreen(); }
			else if (e.getSource() == homeScrn.getCashierButton())
			{ new CashierHomeScreen(); }
			else if (e.getSource() == homeScrn.getChefButton())
			{ new ChefHomeScreen(); }
		}
	}
}